
var usr_list_start=""
		+"<div class='w3-container'>\n"
		+"	<div class='w3-row  w3-btn '  style='background-color:#eee;width:100%;' onclick='location.hash =\"#pageone\";call_usr(this);  '>\n"
			+"	<div class='w3-col s3'>\n"
			+"		<img class='w3-circle' "+image_path+"usr.jpg\" style='position:relative;width:100%'>\n"
			+"	</div>\n"
			+"	<div class='w3-col s9 w3-container'>\n"
				+"	<h4    class='w3-text-teal  '>";

var usr_list_BT=""
		+"<div class='w3-container'>\n"
		+"	<div class='w3-row  w3-btn '  style='background-color:#eee;width:100%;' onclick='location.hash =\"#pageBT_car\";call_usr_BT(this);  '>\n"
			+"	<div class='w3-col s3'>\n"
			+"		<img class='w3-circle' "+image_path+"btcar.jpg\" style='position:relative;width:100%'>\n"
			+"	</div>\n"
			+"	<div class='w3-col s9 w3-container'>\n"
				+"	<h4    class='w3-text-teal  '>";
		
var usr_list_end=""
			+"</h4 >\n"
				+"</div>\n"
			+"</div>  \n"		
		+"</div> ";




var mode="";//local , internet
var car_mode="";//tcp,bluetooth		
var on_user=[];		
var on_user_BT=[];		
var current_call;					
var current_call_BT=0;		
var BT_auto_conect=0;

function mode_select(master_slave)
{

	car_mode="bluetooth";
	document.getElementById("wifi_control").style.visibility="hidden";
	document.getElementById("BT_video_b").style.visibility="hidden"; 
	if((master_slave=="master")&&(mode=="internet"))
	{
		location.hash ="#page0";
	}
	else if((master_slave=="master")&&(mode=="local"))
	{
	//	location.hash ="#pagewifi";
		document.getElementById("wifi_control").style.visibility="visible";
		location.hash ="#pageBT_car";
		document.getElementById("BT_video_b").style.visibility="visible"; 
		window.call_java.JScallJava('p2pwifi',' ');
		
		 
		setTimeout("Set_IP(' ');",8000);
		car_mode="tcp";
		
	}
	else if((master_slave=="slave")&&(mode=="internet"))
	{
		location.hash ="#pageBT";
	}
	else if((master_slave=="slave")&&(mode=="local"))
	{
	//	location.hash ="#pagewifi_slave";
		location.hash ="#page_face";
		alert(read_obj(language_text[0],'hot wifi is opened:',';'));
		open_hotwifi(' ');
		window.call_java.JScallJava('p2p_camera','');
		setTimeout("BT_search();",100);
		BT_auto_conect=1;
		 
	}

}
var old_speed="";
function Car_control(speed)
{
	if(old_speed==speed)
	{
		return;
	}
	 
	document.querySelector('#s_status0_0').innerText ="car:"+ speed;
	
	old_speed=speed;
	if(car_mode=="tcp")
		tcp_car_cmd(speed);
	else
		BT_car_speed(speed);
}
var car_status=0;
function update_car_speed()
{
	var i=0;
	i=old_speed.indexOf("b");
	if(i==0)
	{
		if(old_speed.substr(1,1)=="-")
			Car_control("b-"+bt_speed);
		else
			Car_control("b"+bt_speed);
	}

}
function voice_control(voice_cmd)
{
	
	if(voice_cmd==read_obj(language_text[0],'test_voice:',';'))
		alert("voice test ok");
	if(voice_cmd.match(read_obj(language_text[0],'voice_run:',';')))
	{
		 
		Car_control("b"+bt_speed);
	}
	if(voice_cmd.match(read_obj(language_text[0],'voice_back:',';')))
	{
		 
		Car_control("b-"+bt_speed);
	}
	if(voice_cmd.match(read_obj(language_text[0],'voice_right:',';')))
	{
		 
		Car_control("r1;l-1");
	}
	if(voice_cmd.match(read_obj(language_text[0],'voice_left:',';')))
	{
		 
		Car_control("l1;r-1");
	}
	if(voice_cmd.match(read_obj(language_text[0],'voice_fast:',';')))
	{
		bt_speed=1;
		update_car_speed();
		
	}
	if(voice_cmd.match(read_obj(language_text[0],'voice_slow:',';')))
	{
		bt_speed=4;
		update_car_speed();
	}
	if(voice_cmd.match(read_obj(language_text[0],'voice_stop:',';')))
	{
		 
		Car_control("b0");
	}
}

function video_control()
{
	//alert(send_string);
	window.call_java.JScallJava('video_control','start activity');
	//window.call_java.JScallJava('bluetooth',';\r\n');
}


function open_hotwifi()
{

	window.call_java.JScallJava('hotwifi','open');

}

function w3_open() {
    var x = document.getElementsByClassName("w3-sidenav")[0];
    x.style.display = "block";
}
function w3_close() {
    var x = document.getElementsByClassName("w3-sidenav")[0];
    x.style.display = "none";
}


function add_user(new_id)
{
	var i=0;
	if(new_id=="")
		return;
	for(i=0;i<on_user.length;i++)
	{
		if(on_user[i]==new_id)
			return;
	}
	on_user.push(new_id);
	var htmlw=$('#usr_list').html();
	$('#usr_list').html(htmlw+usr_list_start+new_id+usr_list_end);

}

function BT_search_timeout()
{
	if(BT_auto_conect==1)
	{
		window.call_java.JScallJava('bluetooth','bluetooth stop scan');
		$('#bt_status_gif1').removeClass('loading');
		setTimeout("BT_search();",500);
	}
}
function BT_search()
{
	 $('#bt_status_gif').removeClass('fa fa-search');
	 $('#bt_status_gif1').addClass('loading');
	 $('#bt_status_gif').text('');
	 on_user_BT.length=0;
	 BT_auto_conect=1;
	 //data_cmd('bluetooth scan');//bluetooth connect
	window.call_java.JScallJava('bluetooth','bluetooth scan');
	 setTimeout("BT_search_timeout();",5000);
}
function BT_connect(nx)
{
	window.call_java.JScallJava('bluetooth','bluetooth connect'+nx);
	 $('#bt_status_gif').addClass('fa fa-search');
	 $('#bt_status_gif1').removeClass('loading');
	 $('#bt_status_gif').text('search');
//	 setInterval(function(){BT_car_speed('b4;');}, 5000);
//	 setInterval(function(){BT_car_speed('b0;');}, 7000);
}

function BT_disconnect()
{
	window.call_java.JScallJava('bluetooth','bluetooth disconnect');
	 
}

function add_user_BT(new_id)
{
	var i=0,j=0;
	if(new_id=="")
		return;
///////////
	j=new_id.indexOf("RSheep");
	if(j>=0)
	{
		//if(location.hash ="#pageBT")
		if(BT_auto_conect==1)
		{
			//var t=setTimeout("BT_connect(on_user_BT.length);",1000);
			var t=setTimeout("BT_connect(0);",100);
			//BT_connect(0);
			
			if(location.hash =="#pageBT")
				location.hash ="#pageBT_car"
			else
			{
				if(conn)
					conn.send('BT_connect(0)');
				//alert("BlueTooth connect OK");
			}
		}
		BT_auto_conect=2;
	}
///////////
	for(i=0;i<on_user_BT.length;i++)
	{
		if(on_user_BT[i].substr(j,j+8)==new_id.substr(j,j+8))
			return;
	}
	on_user_BT.push(new_id);


	
	var htmlw=$('#BT_list').html();
	$('#BT_list').html(htmlw+usr_list_BT+new_id+usr_list_end);


}


function call_usr(thisN)
{
	//alert("1");
	var c = thisN.getElementsByTagName("h4")[0];
	var x = c.childNodes[0].nodeValue;  	
	 current_call=x;
	 setTimeout("wakup_call_t();",200);
	 
	//alert(current_call);
}

function call_usr_BT(thisN)
{
	
	//var c = thisN.getElementsByTagName("h1")[0];
	//var x = c.childNodes[0].nodeValue;  	
	// current_call_BT=x;
	current_call_BT=0;
	 alert("call_usr_BT");
	 BT_connect(0);
	//alert(current_call);
}


function y_send_BT()
{
	var sendv="x"+document.getElementById("header_y").value;//document.querySelector('#net_send-id').value;
	//BT_car_speed(sendv);//6 9  11
	Car_control(sendv);
}
var bt_speed=1;
function set_speed_BT()
{
	//alert(bt_speed);
	var sendv=document.getElementById("speed_bt").value;//document.querySelector('#net_send-id').value;
	bt_speed=sendv;
}

var remote_IP='';
function Set_IP(IP_addr)
{
	IP_addr=Get_IP() ;
	//IP_addr=document.getElementById("speed_ip").value;
	//alert(IP_addr);
	//"192.168."
	var i=IP_addr.indexOf("192.168.");
	 
	if(i==0)     
	{
		i=IP_addr.substr(8).indexOf(".");
		remote_IP=IP_addr.substr(0,8+i+1)+"1";
		//alert(remote_IP);
		document.getElementById("car_video").src="http://"+remote_IP+":8080/";
	}
	else
		alert("failed");
		
	
	
}

function Get_IP()
{
	var IP_addr;
	IP_addr=window.call_java.JScallJava('getIP',' ');
	//document.getElementById("speed_ip").value=IP_addr;	
	return IP_addr;
	//alert(IP_addr);
}


function tcp_car_cmd(speed)
{
	//alert(speed);
	 
	{
		 
		window.call_java.JScallJava("TCP_O,"+remote_IP+",8001","");
		window.call_java.JScallJava("TCP_S,"+speed+";\r\n","");
		window.call_java.JScallJava("TCP_C,","");
	}
}




var el ;
var ctx ;
var isDrawing;
var pen_data=[];
var RL=[],rl_c;
function canvas_clear()
{
	 
	ctx.clearRect(0, 0, el.width, el.height);
}
function start_draw()
{
	alert(12);
	  isDrawing = true;
	  ctx.moveTo(e.clientX, e.clientY);
	  pen_data.push(e.clientX);
	  pen_data.push(e.clientY);


}
function canvas_init()
{
	 el = document.getElementById('myCanvas');
	 ctx = el.getContext('2d');

	ctx.lineWidth=10;
	ctx.clearRect(0, 0, el.width, el.height);
	ctx.addEventListener("touchstart", start_draw, false);
	
	/*el.onmousedown = function(e) {
	  isDrawing = true;
	  ctx.moveTo(e.clientX, e.clientY);
	  pen_data.push(e.clientX);
	  pen_data.push(e.clientY);
	//  alert(e.clientX+"  "+e.clientY);
	};//*/
	el.onmousemove = function(e) {
	  if (isDrawing) {
	    ctx.lineTo(e.clientX, e.clientY);
	    ctx.stroke();
		  pen_data.push(e.clientX);
		  pen_data.push(e.clientY);
		
	  }
	};
	el.onmouseup = function() {
	  isDrawing = false;
	//  alert(pen_data);
	  R_VS_L(pen_data);
	//  alert(RL);
	  rl_c=RL.length;
	  
	  
	  
	};

}

function remote_control()
{
	var s=RL[--rl_c],s1;
	var r,l;
	//alert("re"+s);
	if(rl_c>=0)
		setTimeout("remote_control();",1000);
	if(isNaN(s))
		return;
	//s=Math.floor(s);
	 
	s1=(100-Math.abs(s*100))/5;
	if(s1>4)
		s1=4;
	s1=5-s1;
	s1=s1.toFixed(0);

	if(s>0)
	{
		r=5;
		l=s1;
	}
	else
	{
		r=s1;
		l=5;
	}
	document.querySelector('#s_status_q').innerText +=","+ "r"+r+"  "+"l"+l;
	car_cmd("r"+r);
	car_cmd("l"+l);
 	 
 	
}

function canvas_send()
{
	remote_control();
}


function R_VS_L(line)
{
	var  p=20,i=0,k=10,j;
	var tmp,c,b,a,v;
	RL.length=0;
/*	line[0]=5;
	line[1]=19;
	line[2]=6;
	line[3]=19;
	line[4]=8;
	line[5]=19;*/
 	for(i=0;i<line.length/2;i+=p)
	{
		c=0;
		for(j=0;j<p;j++)
		{
			tmp=Math.pow(line[2*(i+j)]-line[2*(i+j+1)], 2)+
				 Math.pow(line[2*(i+j)+1]-line[2*(i+j+1)+1], 2);

			c+=Math.sqrt(tmp);
		}
		tmp=Math.pow(line[2*i]-line[2*(i+p)], 2)+
				 Math.pow(line[2*i+1]-line[2*(i+p)+1], 2);
		b=Math.sqrt(tmp);
		v=b/c;
		//alert(b+" "+c);
		v=v.toFixed(4);
		///sum of 
		c=0,a=0;
		j=p/2;
	//	for(j=0;j<p;j++)
		{
			a=(line[2*(i+j)]-line[2*(i)])/(line[2*(i+j)+1]-line[2*(i)+1]);
		/*	if(j==0)
				a=c;
			else if(Math.abs(a)<Math.abs(c))
				a=c;*/
		}
		c=(line[2*(i+p)]-line[2*(i)])/(line[2*(i+p)+1]-line[2*(i)+1]);
		
		if(c<a)
			 v=0-v; 
		
		RL.push(v);
		
	}
	
/*	  line[2*i]=10;
	 line[2*i+1]=17;
	 line[2*i+(p/2)*2]=12;
	 line[2*i+(p/2)*2+1]=17; 
	 line[2*i+(p )*2]=14;
	 line[2*i+(p )*2+1]=17; 
	
	 for(i=0;i<line.length/2;i++)
	{
		tmp=Math.pow(line[2*i]-line[2*i+(p/2)*2], 2)+
			 Math.pow(line[2*i+1]-line[2*i+(p/2)*2+1], 2);

		c=Math.sqrt(tmp);
		
		tmp=Math.pow(line[2*i]-line[2*i+(p)*2], 2)+
			Math.pow(line[2*i+1]-line[2*i+(p)*2+1], 2);
		b=Math.sqrt(tmp)/2;
		a=Math.abs(c*c-b*b);
		a=Math.sqrt(a);
		
		v=(c*c+2*a*k)/(c*c-2*a*k);
		 alert(a+"  "+c+"  "+v); 
		
		v=v.toFixed(4);
		RL.push(v);
	}
	*/
}


    $(document).ready(function()
    {
/*
	var htmlw=$('#usr_list').html();
	 $('#usr_list').html(htmlw+usr_list_start+"123"+usr_list_end);
	var htmlw=$('#usr_list').html();

	 $('#usr_list').html(htmlw+usr_list_start+"123"+usr_list_end);
*///	alert($('#usr_list').html());
	/// canvas_init();
	//init();
	//document.getElementById("car_video").style.transform="rotate(-90deg)"
	$('#pointsx').change(function() {
      		x_send();
	});		
	$('#pointsy').change(function() {
      		y_send();
	});	
	/////////
//	$( "#c_front" ).addEventListener("touchstart", car_cmd("b1"), false);
	var bt_car;
	bt_car=document.getElementById("c_front");
	bt_car.addEventListener('touchstart', function(e) {car_cmd("b1");}, false);
	bt_car.addEventListener('touchend', function(e) {car_cmd("b0");}, false);
	bt_car=document.getElementById("c_right");
	bt_car.addEventListener('touchstart', function(e) {car_cmd("r2");car_cmd("l-2");}, false);
	bt_car.addEventListener('touchend', function(e) {car_cmd("b0");}, false);
	bt_car=document.getElementById("c_back");
	bt_car.addEventListener('touchstart', function(e) {car_cmd("b-3");}, false);
	bt_car.addEventListener('touchend', function(e) {car_cmd("b0");}, false);
	bt_car=document.getElementById("c_left");
	bt_car.addEventListener('touchstart', function(e) {car_cmd("l2");car_cmd("r-2");}, false);
	bt_car.addEventListener('touchend', function(e) {car_cmd("b0");}, false);
	document.getElementById("wifi_control").style.visibility="hidden";
	document.getElementById("BT_video_b").style.visibility="hidden"; 
	 return;

	//////////

    });



    var canvas,ctx;

    // Variables to keep track of the mouse position and left-button status 
    var mouseX,mouseY,mouseDown=0;

    // Variables to keep track of the touch position
    var touchX,touchY;

    // Draws a dot at a specific position on the supplied canvas name
    // Parameters are: A canvas context, the x position, the y position, the size of the dot
    function drawDot(ctx,x,y,size) {
        // Let's use black by setting RGB values to 0, and 255 alpha (completely opaque)
	pen_data.push(x);
	pen_data.push(y);
	if(size==0)
	{
		
		 R_VS_L(pen_data);
		//    alert(pen_data+"___"+RL);
		  rl_c=RL.length;
		//  remote_control();
	  
		return;
	}
	  
	r=0; g=0; b=0; a=255;

        // Select a fill style
        ctx.fillStyle = "rgba("+r+","+g+","+b+","+(a/255)+")";

        // Draw a filled circle
        ctx.beginPath();
        ctx.arc(x, y, size, 0, Math.PI*2, true); 
        ctx.closePath();
        ctx.fill();
    } 

    // Clear the canvas context using the canvas width and height
    function clearCanvas(canvas,ctx) {
        ctx.clearRect(0, 0, canvas.width, canvas.height);
    }

    // Keep track of the mouse button being pressed and draw a dot at current location
    function sketchpad_mouseDown() {
    	 pen_data.length=0;
        mouseDown=1;
        drawDot(ctx,mouseX,mouseY,12);
    }

    // Keep track of the mouse button being released
    function sketchpad_mouseUp() {
        mouseDown=0;
	 drawDot(ctx,mouseX,mouseY,0);	
    }

    // Keep track of the mouse position and draw a dot if mouse button is currently pressed
    function sketchpad_mouseMove(e) { 
        // Update the mouse co-ordinates when moved
        getMousePos(e);

        // Draw a dot if the mouse button is currently being pressed
        if (mouseDown==1) {
            drawDot(ctx,mouseX,mouseY,12);
        }
    }

    // Get the current mouse position relative to the top-left of the canvas
    function getMousePos(e) {
        if (!e)
            var e = event;

        if (e.offsetX) {
            mouseX = e.offsetX;
            mouseY = e.offsetY;
        }
        else if (e.layerX) {
            mouseX = e.layerX;
            mouseY = e.layerY;
        }
     }

    // Draw something when a touch start is detected
    function sketchpad_touchStart() {
        // Update the touch co-ordinates
        pen_data.length=0;
        getTouchPos();

        drawDot(ctx,touchX,touchY,12);

        // Prevents an additional mousedown event being triggered
        event.preventDefault();
    }

    // Draw something and prevent the default scrolling when touch movement is detected
    function sketchpad_touchMove(e) { 
        // Update the touch co-ordinates
        getTouchPos(e);

        // During a touchmove event, unlike a mousemove event, we don't need to check if the touch is engaged, since there will always be contact with the screen by definition.
        drawDot(ctx,touchX,touchY,12); 

        // Prevent a scrolling action as a result of this touchmove triggering.
        event.preventDefault();
    }

    function sketchpad_touchEnd(e) { 
        // Update the touch co-ordinates
        getTouchPos(e);

        // During a touchmove event, unlike a mousemove event, we don't need to check if the touch is engaged, since there will always be contact with the screen by definition.
        drawDot(ctx,touchX,touchY,0); 

        // Prevent a scrolling action as a result of this touchmove triggering.
        event.preventDefault();
    }

    // Get the touch position relative to the top-left of the canvas
    // When we get the raw values of pageX and pageY below, they take into account the scrolling on the page
    // but not the position relative to our target div. We'll adjust them using "target.offsetLeft" and
    // "target.offsetTop" to get the correct values in relation to the top left of the canvas.
    function getTouchPos(e) {
        if (!e)
            var e = event;

        if(e.touches) {
            if (e.touches.length == 1) { // Only deal with one finger
                var touch = e.touches[0]; // Get the information for finger #1
                touchX=touch.pageX-touch.target.offsetLeft;
                touchY=touch.pageY-touch.target.offsetTop;
            }
        }
    }


    // Set-up the canvas and add our event handlers after the page has loaded
    function init() {
        // Get the specific canvas element from the HTML document
        canvas = document.getElementById('myCanvas');

        // If the browser supports the canvas tag, get the 2d drawing context for this canvas
        if (canvas.getContext)
            ctx = canvas.getContext('2d');

        // Check that we have a valid context to draw on/with before adding event handlers
        if (ctx) {
            // React to mouse events on the canvas, and mouseup on the entire document
            canvas.addEventListener('mousedown', sketchpad_mouseDown, false);
            canvas.addEventListener('mousemove', sketchpad_mouseMove, false);
            window.addEventListener('mouseup', sketchpad_mouseUp, false);

            // React to touch events on the canvas
            canvas.addEventListener('touchstart', sketchpad_touchStart, false);
            canvas.addEventListener('touchmove', sketchpad_touchMove, false);
            canvas.addEventListener('touchend', sketchpad_touchEnd, false);
        }
    }

var old_page="#page0_0";
function click_face()
{
	location.hash =old_page;

}

function  eyes_dis(path)
{
	document.getElementById("face_img0").src = image_path_r+path;
	document.getElementById("face_img1").src = image_path_r+path;
	document.getElementById("face_img0").style.transform = "rotate(90deg)";
	document.getElementById("face_img1").style.transform = "rotate(90deg)";

}
var timer_f=0;
var timer_t=0;
var voice_start_flag=0;
function voice_control_onoff()
{
	voice_start_flag=1;

}

function face_interval()
{
	
	if(location.hash =="#page_face")
	{
		timer_f++;
		if(timer_f==0)
			eyes_dis("l.png");
		else if(timer_f==1)
			eyes_dis("m.png");
		else if(timer_f==2)
		{
			eyes_dis("r.png");
			timer_f=-1;
		}
		//window.call_java.JScallJava('voice_start_cmd:','voice');
		//document.getElementById("face_img0").style = "top:10%;left:0%";
		
	}
	if(/*(location.hash =="#page0_0")||*/(voice_start_flag==1)&&(BT_auto_conect==2))
	{
		timer_t++;
		if(timer_t>1)
		{
			timer_t=0;
			location.hash ="#page_face";
			window.call_java.JScallJava('voice_start_cmd:','voice');
			
		}
	}
	
}
var degv=90;
function RotateVideo()
{
	
	document.getElementById("remote-video").style.webkitTransform = "rotate("+degv+"deg)";
	degv+=90;
	if(degv>=360)
		degv=0;
}

function robot_init()
{
	setInterval(function(){face_interval()}, 1000);
	
	document.getElementById("car_control_ui0").style.visibility="hidden";
	document.getElementById("car_control_ui1").style.visibility="hidden";
//	document.getElementById("rotate_video").style.visibility="visible";

	
 	$('#Choose_connection').text(read_obj(language_text[0],'Choose connection:',';'));
 	$('#Internet0').text(read_obj(language_text[0],'Internet:',';'));
 	$('#Wifi_P2P').text(read_obj(language_text[0],'Wifi P2P:',';'));
 	$('#BlueTooth').text(read_obj(language_text[0],'BlueTooth:',';'));
 	$('#bt_status_gif').text(read_obj(language_text[0],'search:',';'));
 	$('#back0').text(read_obj(language_text[0],'back:',';'));
 	$('#back1').text(read_obj(language_text[0],'back:',';'));
 	$('#BT_video_b').text(read_obj(language_text[0],'video:',';'));
 	$('#speed').text(read_obj(language_text[0],'speed:',';'));
 	$('#header').text(read_obj(language_text[0],'header:',';'));
 	$('#master').text(read_obj(language_text[0],'master:',';'));
 	$('#slave').text(read_obj(language_text[0],'slave:',';'));
 	$('#back2').text(read_obj(language_text[0],'back:',';'));
 	$('#back3').text(read_obj(language_text[0],'back:',';'));
 	$('#back4').text(read_obj(language_text[0],'back:',';'));
 	$('#open hot wifi').text(read_obj(language_text[0],'open hot wifi:',';'));
 	$('#Users').text(read_obj(language_text[0],'Users:',';'));
 	$('#My_ID').text(read_obj(language_text[0],'My ID:',';'));
 	$('#Pass_word').text(read_obj(language_text[0],'Pass word:',';'));
 	$('#login2').text(read_obj(language_text[0],'Save:',';'));
 	$('#Close').text(read_obj(language_text[0],'Close:',';'));
 	$('#back5').text(read_obj(language_text[0],'back:',';'));
 	$('#back5').text(read_obj(language_text[0],'back:',';'));
 	$('#back5').text(read_obj(language_text[0],'back:',';'));
 	$('#back5').text(read_obj(language_text[0],'back:',';'));
 	$('#angle').text(read_obj(language_text[0],'angle:',';'));
 	//$('#rotate_video').text(read_obj(language_text[0],'rotate_video:',';'));
 	$('#car_ui').text(read_obj(language_text[0],'car_ui:',';'));
 	$('#connect_car').text(read_obj(language_text[0],'connect_car:',';'));
	
	
}

function mesg_pro(mesg)
{
	if(mesg=="BT_connect(0)")
	{
		document.getElementById("car_control_ui0").style.visibility="visible";
		document.getElementById("car_control_ui1").style.visibility="visible";
		document.getElementById("car_loading0").style.visibility="hidden";
		document.getElementById("car_loading1").style.visibility="hidden";

	}
}
